package org.tigr.htc.cmd;

/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

import java.util.EventListener;

/**
* The interface <code>CommandTaskLI</code> defines the interface for an object
* that listens to fine grained changes in the command execution status change such as
* execution start, restart, finish, failure, and interruption.
*
*/
public interface CommandTaskLI extends EventListener {
    /**
     * The method <code>commandStarted</code> tells listeners that command execution has
     * begun
     *
     * @param pEvent a <code>StartEvent</code> object
     */
    public void taskStarted(TkStartEvent pEvent);

    /**
     * The <code>commandRestarted</code> method notifies interested listeners that the
     * command execution of a unsuccessful command has restarted. This notification is
     * therefore valid only in the context of the resumption of a previously failed
     * command.
     *
     * @param pEvent a <code>StartEvent</code> value
     */
    public void taskRestarted(TkStartEvent pEvent);

    /**
     * The method <code>commandFinished</code> notifies listeners that command execution
     * is complete
     *
     * @param pEvent a <code>FinishEvent</code> object
     */
    public void taskFinished(TkFinishEvent pEvent);

    /**
     * The <code>commandInterrupted</code> method notifies interested listeners that the
     * command execution was interrupted.
     *
     * @param pEvent an <code>InterruptEvent</code> object.
     */
    public void taskInterrupted(TkInterruptEvent pEvent);

    /**
     * The method <code>commandFailed</code> notifies listeners when the command
     * execution encountered an exceptional condition such as a file not found, or some
     * other exception
     *
     * @param pEvent a <code>FailureEvent</code> that holds the exception that caused
     * this event to the sent.
     *
     */
    public void taskFailed(TkFailureEvent pEvent);

    /**
     * The method <code>commandSubmitted</code> notifies the listeners that the command
     * was accepted by the job scheduling system.
     *
     * @param pEvent a <code>SubmitEvent</code> object
     */
    public void taskSubmitted(TkSubmitEvent pEvent);

    /**
     * The method <code>commandResumed</code> notifies listeners that command execution
     * was resumed after a suspension.
     *
     * @param pEvent a <code>ResumeEvent</code> object
     */
    public void taskResumed(TkResumeEvent pEvent);

    /**
     * The method <code>commandSuspended</code> notifies listeners that the command
     * execution was suspended.
     *
     * @param pEvent a <code>SuspendEvent</code> object.
     */
    public void taskSuspended(TkSuspendEvent pEvent);

}
